#!/bin/bash
#初始化远程终端目录权限

error_exit(){
	echo "ERROR:初始化远程终端目录权限失败"
	exit 1
}

sshIp=$1
port=$2
sshRootPass=$3
#远程终端用户组 java为tomcat,php为apache
sshNewGroup=$4
sshDir=$5

sshNewUser="beetle"
#当前beetle机器登录用户名
loginUser=`whoami`

echo "==========初始化远程终端目录权限开始=========="
expect beetle_terminal_dir.sh ${sshIp} ${sshRootPass} ${sshNewUser} ${loginUser} ${sshDir} ${sshNewGroup} ${port} || error_exit
echo "==========初始化远程终端目录权限成功=========="